﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Db
{
    public class Transaction
    {
        private List<Statement> statements = new List<Statement>();
        private int count = 0;

        public void Add(Statement stm)
        {
            if (stm.Stmt.Length > 0)
            {
                statements.Add(stm);
                count++;
            }
        }

        public bool Remove(Statement stm)
        {
            bool result = false;
            result = statements.Remove(stm);

            if (result)
            {
                count--;
            }

            return result;
        }

        public int Count
        {
            get { return count; }
        }
        
        public List<Statement> Statements
        {
            get { return statements; }
            set { statements = value; }
        }
        
    }
}
